/*河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
*/
package cn.javaxc.mes.action.produce;
import java.io.*;
import java.util.*;
import java.sql.*;
import cn.javaxc.model.base.SQL;
import cn.javaxc.model.base.SQLList;
import cn.javaxc.model.base.SQLMap;
import cn.javaxc.model.base.SQLParam;
import cn.javaxc.model.page.BatisPage;
import cn.javaxc.mvcwork.controller.web.TreeBean;
import cn.javaxc.mvcwork.util.common.CommonUtil;
import cn.javaxc.mvcwork.util.common.MapListUtil;
import cn.javaxc.mvcwork.util.helper.FrameHelper;
import cn.javaxc.mvcwork.util.helper.TreeTableHelper;
import org.springframework.beans.factory.annotation.Autowired;
import cn.javaxc.system.action.base.BaseAction;
import cn.javaxc.mes.mapper.produce.DevSupplierMapper;
public class DevSupplier extends BaseAction
{
    @Autowired(required=false)
	private DevSupplierMapper mapper;
    /**
    设备信息供应商信息
    */
    
    public Map devSupplier() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> message=mapper.message(params);
        SQLMap message_emt=message.getExistfirst();
        result.put("message", message_emt);
        
        
        
        return result;
    }
    /**
    明细公用页
    */
    
    public Map devSupplierDet() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phones=mapper.phones(params);
        result.put("phones", phones);
        
        
        SQLList<SQLMap> address=mapper.address(params);
        SQLMap address_emt=address.getExistfirst();
        result.put("address", address_emt);
        
        
        SQLList<SQLMap> email=mapper.email(params);
        result.put("email", email);
        
        
        SQLList<SQLMap> moment_info=mapper.moment_info(params);
        result.put("moment_info", moment_info);
        
        
        
        return result;
    }
    /**
    增加电话号码
    */
    
    public Map devSupplierPhoAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phone=mapper.phone(params);
        result.put("phone", phone);
        
        
        SQLList<SQLMap> phonetype=mapper.phonetype(params);
        result.put("phonetype", phonetype);
        
        return result;
    }
    /**
    增加电子邮件
    */
    
    public Map devSupplierEmailAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> mails=mapper.mails(params);
        result.put("mails", mails);
        
        
        SQLList<SQLMap> emailtype=mapper.emailtype(params);
        result.put("emailtype", emailtype);
        
        return result;
    }
    /**
    增加即时通讯地址
    */
    
    public Map devSupplierImmAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> momentcon=mapper.momentcon(params);
        result.put("momentcon", momentcon);
        
        
        SQLList<SQLMap> momentconano=mapper.momentconano(params);
        result.put("momentconano", momentconano);
        
        
        SQLList<SQLMap> ims=mapper.ims(params);
        result.put("ims", ims);
        
        return result;
    }
    /**
    增加地址
    */
    
    public Map devSupplierAdreAdd() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> textmsgs=mapper.textmsgs(params);
        result.put("textmsgs", textmsgs);
        
        
        
        return result;
    }
    /**
    修改公用页
    */
    
    public Map devSupplierUp() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        SQLList<SQLMap> phone=mapper.phone(params);
        result.put("phone", phone);
        
        
        SQLList<SQLMap> address=mapper.address(params);
        SQLMap address_emt=address.getExistfirst();
        result.put("address", address_emt);
        
        
        SQLList<SQLMap> email_info=mapper.email_info(params);
        result.put("email_info", email_info);
        
        
        SQLList<SQLMap> phonetype=mapper.phonetype(params);
        result.put("phonetype", phonetype);
        
        
        SQLList<SQLMap> emailtype=mapper.emailtype(params);
        result.put("emailtype", emailtype);
        
        
        SQLList<SQLMap> contact_ifno=mapper.contact_ifno(params);
        result.put("contact_ifno", contact_ifno);
        
        
        
        
        SQLList<SQLMap> momentcon=mapper.momentcon(params);
        result.put("momentcon", momentcon);
        
        
        SQLList<SQLMap> momentconano=mapper.momentconano(params);
        result.put("momentconano", momentconano);
        
        
        
        
        SQLList<SQLMap> s_province=mapper.s_province(params);
        result.put("s_province", s_province);
        
        
        SQLList<SQLMap> s_city=mapper.s_city(params);
        result.put("s_city", s_city);
        
        
        SQLList<SQLMap> s_district=mapper.s_district(params);
        result.put("s_district", s_district);
        
        
        
        return result;
    }
    /**
    增加电话号码修改
    */
    
    public Map devSupplierPhoAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("phones")){
            params=new SQLParam(request,emt.getMap());
            mapper.ph_id(params);
        }
        
        return result;
    }
    /**
    增加电子邮件修改
    */
    
    public Map devSupplierEmailAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("email")){
            params=new SQLParam(request,emt.getMap());
            mapper.em_id(params);
        }
        
        return result;
    }
    /**
    增加即时通讯地址修改
    */
    
    public Map devSupplierImmAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("moment_contact")){
            params=new SQLParam(request,emt.getMap());
            mapper.devSupplierImmAddSubmit(params);
        }
        
        return result;
    }
    /**
    增加地址修改
    */
    
    public Map devSupplierAdreAddSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("address")){
            params=new SQLParam(request,emt.getMap());
            mapper.address(params);
        }
        
        return result;
    }
    /**
    修改公用页修改
    */
    
    public Map devSupplierUpSubmit() {
        
        Map result=new HashMap();
        SQLParam params=new SQLParam(request,result);
        
        for (SQLMap emt:hqlBean.getTableElements("phones")){
            params=new SQLParam(request,emt.getMap());
            params.def("phone_area",null);
            mapper.b_phones(params);
        }
        
        
        mapper.devSupplierUpSubmit(params);
        
        
        for (SQLMap emt:hqlBean.getTableElements("email")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_email(params);
        }
        
        
        for (SQLMap emt:hqlBean.getTableElements("moment_contact")){
            params=new SQLParam(request,emt.getMap());
            mapper.b_moment_contact(params);
        }
        
        return result;
    }
}